<!DOCTYPE html>
<html lang="en">

<!-- Head tag -->
<head><meta name="generator" content="Hexo 3.8.0">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="google-site-verification" content="xBT4GhYoi5qRD5tr338pgPM5OWHHIDR6mNg1a3euekI">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="每天进步一点点(node.js, javasctipt, vue, vuex, react, redux, mobx, less, sass...)">
    <meta name="keyword" content="">
    <link rel="shortcut icon" href="/img/ironman-draw.png">
    <!-- Place this tag in your head or just before your close body tag. -->
    <script async defer src="https://buttons.github.io/buttons.js"></script>
    <title>
        
          
        
    </title>

    <link rel="canonical" href="http://yoursite.com/">

    <!-- Bootstrap Core CSS -->
    <link rel="stylesheet" href="/css/bootstrap.min.css">

    <!-- Custom CSS --> 
    <link rel="stylesheet" href="/css/beantech.min.css">
    
    <!-- Pygments Highlight CSS -->
    <link rel="stylesheet" href="/css/highlight.css">

    <link rel="stylesheet" href="/css/widget.css">

    <link rel="stylesheet" href="/css/rocket.css">

    <link rel="stylesheet" href="/css/signature.css">

    <link rel="stylesheet" href="/css/toc.css">

    <!-- Custom Fonts -->
    <!-- <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> -->
    <!-- Hux change font-awesome CDN to qiniu -->
    <link href="https://cdn.staticfile.org/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">


    <!-- Hux Delete, sad but pending in China
    <link href='http://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/
    css'>
    -->


    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- ga & ba script hoook -->
    <script></script>
</head>


<!-- hack iOS CSS :active style -->
<body ontouchstart="">
	<!-- Modified by Yu-Hsuan Yen -->
<!-- Post Header -->
<style type="text/css">
    header.intro-header{
        
            background-image: url('') 
            /*config*/
        
    }
    
</style>

<header class="intro-header">
    <!-- Signature -->
    <div id="signature">
        <div class="container">
            <div class="row">
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                
                    <div class="site-heading">
                        <h1>打不死的狒狒</h1>
                        <!--<hr class="small">-->
                        <span class="subheading">不积跬步无以成千里，不积小流无以成江海</span>
                    </div>
                


                </div>
            </div>
        </div>
    </div>
</header>

	
    <!-- Navigation -->
<nav class="navbar navbar-default navbar-custom navbar-fixed-top">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header page-scroll">
            <button type="button" class="navbar-toggle">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/">打不死的狒狒</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <!-- Known Issue, found by Hux:
            <nav>'s height woule be hold on by its content.
            so, when navbar scale out, the <nav> will cover tags.
            also mask any touch event of tags, unfortunately.
        -->
        <div id="huxblog_navbar">
            <div class="navbar-collapse">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="/">Home</a>
                    </li>

                    

                        
                    

                        
                    

                        
                    

                        
                    

                        
                        <li>
                            <a href="/tags/">tags</a>
                        </li>
                        
                    
                    
                </ul>
            </div>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>
<script>
    // Drop Bootstarp low-performance Navbar
    // Use customize navbar with high-quality material design animation
    // in high-perf jank-free CSS3 implementation
    var $body   = document.body;
    var $toggle = document.querySelector('.navbar-toggle');
    var $navbar = document.querySelector('#huxblog_navbar');
    var $collapse = document.querySelector('.navbar-collapse');

    $toggle.addEventListener('click', handleMagic)
    function handleMagic(e){
        if ($navbar.className.indexOf('in') > 0) {
        // CLOSE
            $navbar.className = " ";
            // wait until animation end.
            setTimeout(function(){
                // prevent frequently toggle
                if($navbar.className.indexOf('in') < 0) {
                    $collapse.style.height = "0px"
                }
            },400)
        }else{
        // OPEN
            $collapse.style.height = "auto"
            $navbar.className += " in";
        }
    }
</script>


    <!-- Main Content -->
    <!-- Main Content -->
<div class="container">
    <div class="row">
        

<!-- USE SIDEBAR -->
    <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-1
                col-md-8 col-md-offset-1
                col-sm-12
                col-xs-12
                post-container
            ">
            
                <!-- Main Content -->


<div class="post-preview">

    <a href="/2018/12/22/wechat-miniapp/">
        <h2 class="post-title">
            小程序登录授权
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            小程序授权登录整体流程如下：

登录授权  页面进入需判断是否授权时，在页面onShow生命周期：
  12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758onShow() &#123;  login() &#123;    wx.......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-12-22
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/12/22/wechat-OAuth/">
        <h2 class="post-title">
            微信公众号授权第三方平台
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            整理下公众号授权，以备不时之需。授权登录并获取用户基本信息。简略步骤如下：  1、用户同意授权 获取code  2、通过 code换取到 access_token  3、适当时候刷新 access_token  4、获取用户信息
第一步：用户同意授权，获取code  检查用户是否授权登录（如token有效性），打开授权跳转链接：  参考链接(官方示例)，具体链接参数信息参考官网  12345......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-12-22
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/12/22/react-proxy/">
        <h2 class="post-title">
            react多个代理时的设置方法
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            项目中可能会需要根据环境变量不同切换访问不同域名下api的需要，这时候就需要设置代理，不然会出现跨域问题，我在项目开发中遇到的是根据查询资料说多个代理地址时也是在package.json文件内以对象的形式设置proxy
这样设置有问题，应该是我当前项目版本比较高1234567891011"proxy": &#123;    "/api1": &#123;        "target": "......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-12-22
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/12/22/add-react-env/">
        <h2 class="post-title">
            react项目环境变量添加
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            默认环境变量 可以使用的环境变量有NODE_ENV(这个环境变量已经定义好了)，这是一个内置的环境变量，你可以通过process.env.NODE_ENV访问到这个变量，react不允许自己设置这个变量的值，默认已经设置好了，有development,test,production这几种情况
自定义环境变量 如果需要自行定义环境变量，需要以REACT_APP_开头设置，否则设置无效会被忽略，......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-12-22
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/12/12/tab-component/">
        <h2 class="post-title">
            基于vue的tab切换组件
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            项目中引入的UI组件–tab组件在项目使用上有点无法满足UI布局及设计，所以自己重新开发了一版tab组件
demo.vue
1234567&lt;tab   :active-color="'#333'"  :bar-active-color="'#FB625B'"  v-model='tabIndex'  @on-item-click="handlerTabItem"&gt;  &lt;ta......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-12-12
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/12/11/burying-point/">
        <h2 class="post-title">
            vue项目数据埋点
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            click埋点统计在已有的项目基础上，做数据埋点统计，前提是不能干扰现有的结构和数据逻辑，将影响降到最低，通过自定义指令可以在节点增加click数据统计。在main.js入口文件配置全局的自定义指令.
12345678910Vue.directive('stat', &#123;  bind(el, binding) &#123;    el.addEventListener('click'......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-12-11
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/12/05/css-module/">
        <h2 class="post-title">
            react中的css样式作用域
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            感觉react的局部样式相比vue要麻烦点，vue可以在style标签上添加scoped，达到使样式作用于当前文件的效果，而react没有，但是react有其他的实现方式，比如我所知道且使用过的css-Modules、styled-components。
css-Modules自动为每一个类生成一个哈希值，产生惟一标志，因此避免了类的覆盖，如下图：

这里需要配置wepack文件，react......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-12-05
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/11/28/typescript/">
        <h2 class="post-title">
            TypeScript入门（1）
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            抽点时间，看看TypeScript的文档，学习下关于ts语法相关。
什么是TypeScript?TypeScript 是 JavaScript 的类型的超集，它可以编译成纯 JavaScript。编译出来的 JavaScript 可以运行在任何浏览器上。TypeScript 编译工具可以运行在任何服务器和任何系统上。TypeScript 是开源的。（官方解释，直接拿来）
原始数据类型java......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-11-28
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/11/26/react-redux/">
        <h2 class="post-title">
            redux和react-redux
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            关于reduxredux是JavaScript应用程序的可预测状态容器，对数据集中管理。这对于react高度组件化来说至关重要，不然对于多层嵌套的组件通信就异常的麻烦(这次着重想记录下react-redux)
关于react-redux开始我也不是很明白react-redux又是什么鬼，查了下发现，原来react-redux是简化了我们的state获取和方法的派发，这里有两个关键API

P......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-11-26
        </p>
    

</div>
<hr>

<div class="post-preview">

    <a href="/2018/11/23/reduxMiddleare/">
        <h2 class="post-title">
            Redux中间件之redux-thunk和redux-saga
        </h2>
        <h3 class="post-subtitle">
            
        </h3>
        <div class="post-content-preview">
            中间件 桥接aciton与store的中间连接者
redux-thunk 正常action返回的是一个对象，redux-thunk中间件允许我们返回一个函数，而其中我们可以将我们的异步请求逻辑放在里面，异步操作在action完成
store 123456789101112131415import &#123; createStore, applyMiddleware &#125; from ......
        </div>
    </a>
    
        <p class="post-meta">
            Posted by eason.L on
            2018-11-23
        </p>
    

</div>
<hr>



<!-- Pager -->

<ul class="pager">
    
    
        <li class="next">
            <a href="/page/2/">Older Posts &rarr;</a>
        </li>
    
</ul>



                <br>

                <!-- require APlayer -->
                

                <!-- 如果开启评论功能 -->
                
            </div>

          <!-- Sidebar Container -->
<div class="
    col-lg-3 col-lg-offset-0
    col-md-3 col-md-offset-0
    col-sm-12
    col-xs-12
    sidebar-container
">
    
        <!-- Featured Tags -->

<section>
    <!-- no hr -->
    <h5><a href="/tags/">FEATURED TAGS</a></h5>
    <div class="tags">
        
    </div>
</section>

        <hr>
    
        <!-- Short About -->
<section class="visible-md visible-lg">
    <h5><a href="/about/">ABOUT ME</a></h5>
    <div class="short-about">

        
            <img id="avatar_pic" src="/img/avatar/ironman.jpg">
        

        
            <p>Stay hungry,Stay foolish</p>
        

        <!-- SNS Link -->
        <ul class="list-inline">
            
            
            

            

            

            
            
            
            
        </ul>
    </div>
</section>

        <hr>
    
        
  <h5>RECENT POSTS
  <div class="widget">
    <ul>
      
        <li>
          <a href="/2018/12/22/wechat-miniapp/">小程序登录授权</a>
        </li>
      
        <li>
          <a href="/2018/12/22/wechat-OAuth/">微信公众号授权第三方平台</a>
        </li>
      
        <li>
          <a href="/2018/12/22/react-proxy/">react多个代理时的设置方法</a>
        </li>
      
        <li>
          <a href="/2018/12/22/add-react-env/">react项目环境变量添加</a>
        </li>
      
        <li>
          <a href="/2018/12/12/tab-component/">基于vue的tab切换组件</a>
        </li>
      
    </ul>
  </div>
</h5>
        <hr>
    
        <!-- Friends Blog -->

<h5>FRIENDS</h5>
<ul class="list-inline">

    
        <li><a href="http://blog.csdn.net/123" target="_blank">CSDN 东方</a></li>
    
        <li><a href="http://dockone.io/people/123" target="_blank">掘金 东方</a></li>
    
        <li><a href="https://yq.aliyun.com/u/123" target="_blank">博客园 东方</a></li>
    
</ul>

        <hr>
    
        
    <h5>ARCHIVES</h5>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/12/">十二月 2018</a></li><li class="archive-list-item"><a class="archive-list-link" href="/archives/2018/11/">十一月 2018</a></li></ul>
    </div>

        <hr>
    
        <!-- Categories -->

        <hr>
    
</div>

        
    </div>
</div>


    <!-- Footer -->
    <!-- Footer -->
<footer>
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <ul class="list-inline text-center">
                
                
                

                

                

                

                

                </ul>
                <p class="copyright text-muted">
                    Copyright &copy; eason.L 2018 
                    <br>
                    Theme by <a href="http://beantech.org">BeanTech</a> 
                    <span style="display: inline-block; margin: 0 5px;">
                        <i class="fa fa-heart"></i>
                    </span> 
                    re-Ported by <a href="https://github.com/eason1999">eason.L</a> | 
                    <iframe style="margin-left: 2px; margin-bottom:-5px;" frameborder="0" scrolling="0" width="91px" height="20px" src="https://ghbtns.com/github-btn.html?user=eason1999&repo=hexo-theme-huweihuang&type=star&count=true">
                    </iframe>
                </p>
            </div>
        </div>
    </div>
</footer>

<!-- jQuery -->
<script src="/js/jquery.min.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="/js/bootstrap.min.js"></script>

<!-- Custom Theme JavaScript -->
<script src="/js/hux-blog.min.js"></script>


<!-- async load function -->
<script>
    function async(u, c) {
      var d = document, t = 'script',
          o = d.createElement(t),
          s = d.getElementsByTagName(t)[0];
      o.src = u;
      if (c) { o.addEventListener('load', function (e) { c(null, e); }, false); }
      s.parentNode.insertBefore(o, s);
    }
</script>

<!-- 
     Because of the native support for backtick-style fenced code blocks 
     right within the Markdown is landed in Github Pages, 
     From V1.6, There is no need for Highlight.js, 
     so Huxblog drops it officially.

     - https://github.com/blog/2100-github-pages-now-faster-and-simpler-with-jekyll-3-0  
     - https://help.github.com/articles/creating-and-highlighting-code-blocks/    
-->
<!--
    <script>
        async("http://cdn.bootcss.com/highlight.js/8.6/highlight.min.js", function(){
            hljs.initHighlightingOnLoad();
        })
    </script>
    <link href="http://cdn.bootcss.com/highlight.js/8.6/styles/github.min.css" rel="stylesheet">
-->


<!-- jquery.tagcloud.js -->
<script>
    // only load tagcloud.js in tag.html
    if($('#tag_cloud').length !== 0){
        async("http://yoursite.com/js/jquery.tagcloud.js",function(){
            $.fn.tagcloud.defaults = {
                //size: {start: 1, end: 1, unit: 'em'},
                color: {start: '#bbbbee', end: '#0085a1'},
            };
            $('#tag_cloud a').tagcloud();
        })
    }
</script>

<!--fastClick.js -->
<script>
    async("https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js", function(){
        var $nav = document.querySelector("nav");
        if($nav) FastClick.attach($nav);
    })
</script>


<!-- Google Analytics -->




<!-- Baidu Tongji -->






	<a id="rocket" href="#top" class=""></a>
	<script type="text/javascript" src="/js/totop.js?v=1.0.0" async=""></script>
    <script type="text/javascript" src="/js/toc.js?v=1.0.0" async=""></script>
<!-- Image to hack wechat -->
<img src="http://yoursite.com/img/icon_wechat.png" width="0" height="0" />
<!-- Migrate from head to bottom, no longer block render and still work -->

</body>

</html>
